<?php
	$lib_paths = array();
	$lib_paths[] = '/home/ideowski/ftp/zend/application';
	$lib_paths[] = '/home/ideowski/ftp/zend/lib';
	$inc_path = implode(PATH_SEPARATOR, $lib_paths);
	
	set_include_path($inc_path);
	
	require_once 'Zend/Loader.php';
	require_once 'config/Globals.php';
	
	try{
		Zend_Loader::loadClass('Zend_Controller_Front');
		Zend_Loader::loadClass('Zend_Layout');
		Zend_Loader::loadClass('Zend_Translate');
                
                
		Zend_Layout::startMvc(array('layoutPath'=>Globals::getConfig()->dirs->layouts, 'layout'=>'main'));
		$frontController = Zend_Controller_Front::getInstance();
		$frontController->throwExceptions(true);
		$frontController->setParam('noErrorHandler', true);
		$frontController->setControllerDirectory($lib_paths[0].'/controllers/');
		$frontController->dispatch();
                
                
                
                
                
	}catch(Exception $exp){
		$contentType = 'text/html';
		header("Content-Type: $contentType; charset=utf-8");
		echo 'Niespodziewany błąd.';
		echo '<h2>Błąd: '. $exp->getMessage() .'</h2>';
		echo '<pre>'.$exp->getTraceAsString().'</pre>';
	}
?>